package com.fernandomdo.ServiceAdministrator;

// Android Imports
import java.io.IOException;

import android.app.Activity;
import android.os.Bundle;
import android.widget.Toast;
import android.content.Context;

//Project Imports
import com.fernandomdo.ServiceAdministrator.databaseInterface.DatabaseInterface;
import com.fernandomdo.ServiceAdministrator.databaseInterface.DatabaseInterface.DatabaseConstants;

public class ImportDatabase extends Activity {
	private Context appContext;
	private DatabaseInterface databaseInterface;
	
	@Override
	public void onCreate(Bundle bundle) {
		super.onCreate(bundle);
		
		appContext = getApplicationContext();
		databaseInterface = new DatabaseInterface(appContext);
		
		try {
			databaseInterface.importDatabase(DatabaseConstants.DATABASE_NAME);
			Toast.makeText(appContext, "The database was imported", 5).show();
			finish();
		}
		catch (IOException e) {
	
		}
	}	
}
